package com.wp.design.itractor;

import java.util.List;

public class CourseItaractor implements ICourseItaractor{
	private List<Course> list;
	private int position = 0;
	private Course course;
	public CourseItaractor(List<Course> list) {
		this.list = list;
	}

	public boolean hasNext() {
		if (position >= list.size()) {
			return false;
		}
		return true;
	}

	public Course next() {
		System.out.println("返回课程位置："+position);
		course = list.get(position);
		position++;
		return course;
	}
}
